<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    /* 强制转换  number（） */
    /* string ,boolean-->number(value) 
    特点：只能识别纯数字的字符串
    true-->1
    false-->0*/
    var a="12";
    var b="true";
    var c=true;
    var d=false;
    console.log(Number(a));
    console.log(Number(b));
    console.log(Number(c));
    console.log(Number(d));

    </script>
</body>
</html>